package com.nmf.dao.gen;

import com.nmf.dao.gen.bean.BizSysUserRoleExample;
import com.nmf.dao.gen.bean.BizSysUserRoleKey;
import java.util.List;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.DeleteProvider;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.InsertProvider;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Result;
import org.apache.ibatis.annotations.Results;
import org.apache.ibatis.annotations.SelectProvider;
import org.apache.ibatis.annotations.UpdateProvider;
import org.apache.ibatis.type.JdbcType;

public interface BizSysUserRoleMapper {
    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table sys_user_role
     */
    @SelectProvider(type=BizSysUserRoleSqlProvider.class, method="countByExample")
    long countByExample(BizSysUserRoleExample example);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table sys_user_role
     */
    @DeleteProvider(type=BizSysUserRoleSqlProvider.class, method="deleteByExample")
    int deleteByExample(BizSysUserRoleExample example);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table sys_user_role
     */
    @Delete({
        "delete from sys_user_role",
        "where user_id = #{userId,jdbcType=VARCHAR}",
          "and role_id = #{roleId,jdbcType=VARCHAR}"
    })
    int deleteByPrimaryKey(BizSysUserRoleKey key);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table sys_user_role
     */
    @Insert({
        "insert into sys_user_role (user_id, role_id)",
        "values (#{userId,jdbcType=VARCHAR}, #{roleId,jdbcType=VARCHAR})"
    })
    int insert(BizSysUserRoleKey record);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table sys_user_role
     */
    @InsertProvider(type=BizSysUserRoleSqlProvider.class, method="insertSelective")
    int insertSelective(BizSysUserRoleKey record);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table sys_user_role
     */
    @SelectProvider(type=BizSysUserRoleSqlProvider.class, method="selectByExample")
    @Results({
        @Result(column="user_id", property="userId", jdbcType=JdbcType.VARCHAR, id=true),
        @Result(column="role_id", property="roleId", jdbcType=JdbcType.VARCHAR, id=true)
    })
    List<BizSysUserRoleKey> selectByExample(BizSysUserRoleExample example);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table sys_user_role
     */
    @UpdateProvider(type=BizSysUserRoleSqlProvider.class, method="updateByExampleSelective")
    int updateByExampleSelective(@Param("record") BizSysUserRoleKey record, @Param("example") BizSysUserRoleExample example);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table sys_user_role
     */
    @UpdateProvider(type=BizSysUserRoleSqlProvider.class, method="updateByExample")
    int updateByExample(@Param("record") BizSysUserRoleKey record, @Param("example") BizSysUserRoleExample example);
}